package com.cv.infra.job;

import com.cv.infra.service.dynamicThreadPool.DynamicThreadPoolService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 动态线程池定时监听器
 *
 * @author Charles_XDXD
 */
@Slf4j
@Component
public class DynamicThreadPoolListener {

    @Resource
    private DynamicThreadPoolService dynamicThreadPoolService;

    /**
     * 定时每分钟执行一次：检查/调节动态线程池状态
     */
    @XxlJob("listenDynamicThreadPool")
    public void listenDynamicThreadPool() {
        dynamicThreadPoolService.listenDynamicThreadPool();
    }

}
